#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tool_europa as te
import os

path_corpus = "./corpus/europa_collection1"
list_lg = te.get_list_languages(path_corpus)

#dic_res = {}
#for lg in list_lg :
#  dic_res[lg] = []

#dic = te.get_nb_doc_lg(path_corpus, dic_res)

print_res = {}

for lg in list_lg :
  dic = {
    'style_plot'  : 'r-',
    'name_legend' : lg,
    'list_x'      : [],
    'list_y'      : [],
    'xlabel'      : 'years',
    'ylabel'      : 'nb documents'
  }
  for i in xrange(0,10) :
    s = '%01d'%(i)
    dic_res = {lg:[]}
    new_path_corpus = os.path.join(path_corpus,s)
    dic_res = te.get_nb_doc_lg(new_path_corpus, dic_res)
    l = len(dic_res[lg])
    dic['list_x'].append(s)
    dic['list_y'].append(l)

  print_res[lg] = dic

print print_res

#for i in xrange(0,10) :
#  s = '%2d'%(i)
#  new_path_corpus = os.path.join(path_corpus,s)
#  dic_res = {}
#  for lg in list_lg :
#    dic_res[lg] = []
#  dic_res = te.get_nb_doc_lg(new_path_corpus, dic_res)
##  dic = {}
#  dic['style_plot']
#  dic['name_legend']
#  dic['list_x']
#  dic['list_y']
#  dic['xlabel']
#  dic['ylabel']
#  print_res[s] = dic
#
#for lg,data in dic_res.iteritems() :
#  pass

#
#print l
